#ifndef __LM_COMMAN_H__
#define __LM_COMMAN_H__

#include "lm_base.h"

using namespace std;


#define RTMP_SIG_SRS_KEY "LMSS"
#define RTMP_SIG_SRS_CODE "LM"
#define RTMP_SIG_SRS_URL "https://~"
#define RTMP_SIG_SRS_LICENSE "The MIT License (MIT)"
#define RTMP_SIG_SRS_VERSION "1.0"
#define RTMP_SIG_SRS_SERVER RTMP_SIG_SRS_KEY "/" RTMP_SIG_SRS_VERSION "(" RTMP_SIG_SRS_CODE ")"


#define GET_MIN_VALUE(x, y)  (x > y) ? (y) : (x)


uint get_curr_time();
char *convert_sec_to_str(long tm, char *dst);

class messageHeader
{
	public:
		messageHeader()
		{
			timestampDelta = bodyLength = streamId = 0;
			messageType = perferCid = timestamp = 0;
		}

	public:
		uint  timestampDelta;
		uint  bodyLength;
		uchar messageType;
		uint  streamId;
		ullong timestamp;
		int perferCid;
};


class messageBody
{
	public:
		messageBody()
		{
			payloadSize = 0;
			head   = new messageHeader();
			payload = NULL;
		}

		~ messageBody()
		{
			FREE_OBJ(head);
		}
		
	public:
		uint payloadSize;
		char *payload;
		messageHeader *head;
};


#endif


